public class Methods {

	public static int mod(int a, int b) {
		return (a % b + b) % b;
	}

	@Deprecated
	public static int charToNums(char c) {
		for (int i = 0; i < Constants.ALFABET.length(); i++) {
			if (Character.toString(c).equalsIgnoreCase(
					Character.toString(Constants.ALFABET.charAt(i)))) {
				return i;
			}
		}
		return -1;
	}
	
	public static int charToNum(char c) {
		return ((int) Character.toLowerCase(c)) -97;
	}

	public static String createKey(String s, String k) {
		String out = "";
		int x = 0;

		while (out.length() < s.length()) {
			if (x == k.length()) {
				x = 0;
			}
			out += k.charAt(x);
			x++;
		}
		return out;
	}

}
